﻿<UserControl x:Class="ViewExternalData"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="5" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel  VerticalAlignment="Center">
            <UniformGrid  Columns="4"  Margin="10" >
                <UniformGrid.Resources>
                    <Style TargetType="RadioButton">
                        <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
                        <Setter Property="BorderThickness" Value="0" />
                        <Setter Property="Margin" Value="0" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="RadioButton">
                                    <Border Name="Border" Padding="10" CornerRadius="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"  BorderThickness="{TemplateBinding BorderThickness}">
                                        <ContentPresenter  HorizontalAlignment="Center" />
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsChecked" Value="True">
                                            <Setter Property="Background" Value="Black" />
                                            <Setter Property="Foreground" Value="White" />
                                            <Setter Property="FontWeight" Value="Bold" />
                                        </Trigger>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="RenderTransform" >
                                                <Setter.Value>
                                                    <ScaleTransform ScaleX="0.95" ScaleY="0.95" />
                                                </Setter.Value>
                                            </Setter>
                                            <Setter Property="BorderThickness" Value="2" />
                                            <Setter Property="CornerRadius" Value="5" TargetName="Border" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </UniformGrid.Resources>
                <RadioButton Name="CSVRadioButton" Content="CSV/TXT" GroupName="DataSourceRadioButtonGroup" />
                <RadioButton Name="EXCELRadioButton" Content="EXCEL" GroupName="DataSourceRadioButtonGroup" />
                <RadioButton Name="SASRadioButton" Content="SAS" GroupName="DataSourceRadioButtonGroup" />
                <RadioButton Name="SQLRadioButton" Content="SQL" GroupName="DataSourceRadioButtonGroup"/>
            </UniformGrid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Border CornerRadius="5" Margin="10" BorderThickness="1" BorderBrush="Black" >
                    <TextBlock VerticalAlignment="Center" Margin="1" Name="FileTextBlock" />
                </Border>
                <Button Grid.Column="1" Content="Importer" Padding="5" Margin="10" Click="Button_Click" />
            </Grid>
        </StackPanel>

        <GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="1" />
        <DataGrid Grid.Row="2" Name="PreviewDataGrid" IsReadOnly="True" EnableColumnVirtualization="True" EnableRowVirtualization="True" />
    </Grid>
</UserControl>
